\documentclass[UTF8]{ctexart}
\usepackage{listings} 
\usepackage{xcolor}
\usepackage{fancyhdr}%设置页脚页眉需要的包
\pagestyle{fancy}
\usepackage{graphicx}
\usepackage{cite}
\usepackage{booktabs}
\usepackage{tikz}
\documentclass{article}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{float}
\usepackage{amsthm}
\usepackage{xeCJK}
\usepackage{graphicx}
\usepackage{fullpage}
\usepackage{gnuplottex}
\usepackage{geometry}
\usepackage{enumitem}
\usepackage{verbatimbox}
\usepackage{amsfonts,amssymb} 
\usepackage[ruled,linesnumbered]{algorithm2e}
\usepackage[colorlinks,linkcolor=blue,citecolor=blue]{hyperref}
\usepackage{cite}
\CTEXsetup[format={\Large\bfseries}]{section}
\newtheorem{example}{例}             % 整体编号
\newtheorem{theorem}{定理}[section]  % 按 section 编号
\newtheorem{definition}{定义}
\newtheorem{axiom}{公理}
\newtheorem{property}{性质}
\newtheorem{proposition}{命题}
\newtheorem{lemma}{引理}
\newtheorem{corollary}{推论}
\newtheorem{remark}{注解}
\newtheorem{condition}{条件}
\newtheorem{conclusion}{结论}
\newtheorem{assumption}{假设}
\newcommand{\enabstractname}{Abstract}
\newenvironment{enabstract}{%
    \par\small
    \noindent\mbox{}\hfill{\bfseries \enabstractname}\hfill\mbox{}\par
    \vskip 2.5ex}{\par\vskip 2.5ex}
\usetikzlibrary{positioning, shapes.geometric}
\lstset{
  language=C++,
  frame=shadowbox,
  rulesepcolor=\color{red!20!green!20!blue!20},
  keywordstyle=\color{blue!90}\bfseries,
  commentstyle=\color{red!10!green!70}\textit,
  showstringspaces=false,
  numbers=left,
  numberstyle=\tiny,
  stringstyle=\ttfamily,
  breaklines=true,
  extendedchars=false,
  texcl=true}

\title{Programming Assignment IV}

\author{韩骐骏 \\ (数学科学学院)信息与计算科学3200103585}

\begin{document}

\maketitle

\section{Problem 4.4.2 A}
\subsection{Solution}
The figure is the plot of three functions, where f is the blue curve; G is the red curve, h is the orange curve (the one that is almost flat). It can be seen from the figure that the calculation effect of h function is the most practical, because its floating point number calculation is only twice, and there is almost no error. The effect of g function is the second, and its floating point number calculation is about 14 times; The calculation effect of f function is the worst, and the number of floating point calculations is close to 30, so there will be a large accumulation of errors.\\
\mathbf{因为没调好latex代码，图片直接显示到下一页去了，非常抱歉.}
\begin{figure}[H]
    \centering
    \includegraphics[width=14cm]{pic2}
    \caption{V.(e)}
    \label{fig:galaxy}
\end{figure}

\section{Problem 4.4.2 B}
\subsection{Question I}
We can compute that $$UFL(F)=\beta^{L}=2^{-1}=0.5$$ $$OFL(F)=(\beta-\beta^{1-p})\beta^U=(2-2^{-2})2^1=3.5$$
\subsection{Question II}
All numbers are $0$ and $$\pm1.00_2*2^{-1},\pm1.01_2*2^{-1},\pm1.10_2*2^{-1},\pm1.11_2*2^{-1}$$ $$\pm1.00_2*2^{0},\pm1.01_2*2^{0},\pm1.10_2*2^{0},\pm1.11_2*2^{0}$$ $$\pm1.00_2*2^{1},\pm1.01_2*2^{1},\pm1.10_2*2^{1},\pm1.11_2*2^{1}$$And also we can compute that $#F=2^p(U-L+1)+1=8*3+1=25$, thus we verify the corollary on the cardinality of $F$ in the summary handout.
\subsection{Question III}
As shown in the figure.
\begin{figure}[H]
    \centering
    \includegraphics[width=14cm]{pic3}
    \caption{V.(e)}
    \label{fig:galaxy}
\end{figure}
\subsection{Question IV}
$$\pm0.01_2*2^{-1},\pm0.10_2*2^{-1},\pm0.11_2*2^{-1}$$
\subsection{Question V}
As shown in the figure.
\begin{figure}[H]
    \centering
    \includegraphics[width=14cm]{pic4}
    \caption{V.(e)}
    \label{fig:galaxy}
\end{figure}

\end{document}
